<%@ page language="java" pageEncoding="UTF-8"%>
<div class="container">
	<div class="row">
        <div class="col-sm-9 col-md-9">
        	<div class="panel panel-default">
				<div class="panel-heading">
					最新博文
					<span class="pull-right">
						<a ng-href="#/user/{{home.user.user.id}}/blog">更多»</a>
					</span>
				</div>
				<div class="panel-body">
				
					<div ng-show="newBlogs==null || newBlogs.length==0">
						<div class="alert alert-info"><i class="glyphicon glyphicon-exclamation-sign"></i> 暂时没有博文</div>
					</div>
					
					<table class="table table-hover">
						<tr ng-repeat="blog in newBlogs">
							<td>
								<span class="label label-warning">{{blog.order.name}}</span>
								<span class="label label-danger" ng-show="blog.recommend_time!=null && blog.recommend_time!=0">推荐</span>
								<span class="label label-danger" ng-show="blog.oneself">私有</span>
								<a ng-href="#/blog/{{blog.id}}" title="{{blog.title | textOnly}}">
									{{blog.title | summary:80}}
								</a>
							</td>
						</tr>
					</table>
				</div>
			</div>
			
			<div class="panel panel-default">
				<div class="panel-heading">
					最近动态
				</div>
				<div class="panel-body">
					<div ng-show="active.data==null || active.data.length==0">
						<div class="alert alert-info"><i class="glyphicon glyphicon-exclamation-sign"></i> 暂时没有动态</div>
					</div>
					
					<div ng-repeat="active in active.data">
						<a class="pull-left" ng-href="#/user/{{active.author.id}}/home">
							<img class="media-object panel panel-default" style="width: 32px; height: 32px;" ng-src="{{active.author.headphoto | path}}">
						</a>
						<div class="media-body">
							<small class="pull-right">
								{{active.create_time | formatDate:true}}
							</small>
							<h5 class="media-heading" style="position: relative;left: 10px;">
								<a href="#/user/{{active.author.id}}/home">
									{{active.author.username}}
								</a>
								<span ng-show="{{active.title!=null}}">
									在 <a ng-href="{{active.type.url}}">{{active.title | textOnly | summary:100}}</a>
								</span>
								{{active.type.message}}
							</h5>
							<small class="col-lg-10" ng-show="{{active.content!=null}}">
								{{active.content | textOnly | summary:100}}
							</small>
						</div>
						<hr/>
					</div>
					
					<paginate page-count="active.page_count" sum="active.data_sum" pn="active.pn" click="findActive"></paginate>
				</div>
			</div>
        </div>
        
        <div class="col-sm-3 col-md-3">
        	<div class="panel panel-default">
				<div class="panel-body">
					<div class="media msg">
						<a class="pull-left" ng-href="#/user/{{home.user.user.id}}/home">
							<img class="media-object panel panel-default" style="width: 80px; height: 80px;" ng-src="{{home.user.user.headphoto | path}}">
						</a>
						<div class="media-body">
							<h5 class="media-heading">
								<a ng-href="#/user/{{home.user.user.id}}/home">{{home.user.user.username}}</a>
							</h5>
							
							<div style="color: #bbb; font-size: 12px;">
								{{home.user.user.signature}}
							</div>
						</div>
					</div>
			
					<div class="pull-left">
						<div class="btn-group">
							<button type="button" class="btn btn-success btn-sm" ng-click="follow.create(home.user.user)" ng-show="!home.user.follow">关注</button>
							<button type="button" class="btn btn-info btn-sm" ng-click="follow.clear(home.user.user)" ng-show="home.user.follow">取消</button>
							<button type="button" class="btn btn-info btn-sm" ng-click="mail.create(home.user.user)">私信</button>
						</div>
					</div>
					
					<div class="pull-right" style="color: #bbb;">
						<div style="position: relative;top: 5px;">
							<span>粉丝:<span>{{home.user.user.fans_count}}</span></span>
							&nbsp;/&nbsp;
							<span>关注:<span>{{home.user.user.follow_count}}</span></span>
						</div>
					</div>
				</div>
			</div>

			<div class="panel panel-default">
				<div class="panel-heading">
					关注
				</div>
				<div class="panel-body">
					<div class="alert alert-info" ng-show="home.follow.data==null || home.follow.data.length==0">
						暂时没有关注
					</div>
					<div>
						<span ng-repeat="follow in home.follow.data">
							<a class="pull-left" ng-href="#/user/{{follow.target.id}}/home" title="{{follow.target.username}}">
								<img class="media-object panel panel-default" style="width: 30px; height: 30px;" ng-src="{{follow.target.headphoto | path}}">
							</a>
						</span>
					</div>
				</div>
			</div>
			
			<div class="panel panel-default">
				<div class="panel-heading">
					粉丝
				</div>
				<div class="panel-body">
					<div class="alert alert-info" ng-show="home.fans.data==null || home.fans.data.length==0">
						暂时没有粉丝
					</div>
					<div>
						<span ng-repeat="fans in home.fans.data">
							<a class="pull-left" ng-href="#/user/{{fans.source.id}}/home" title="{{fans.source.username}}">
								<img class="media-object panel panel-default" style="width: 30px; height: 30px;" ng-src="{{fans.source.headphoto | path}}">
							</a>
						</span>
					</div>
				</div>
			</div>
		</div>
    </div>
</div>